package com.design.pattern.responsibility.config;

import com.design.pattern.responsibility.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Bank01 ----> Bank02 ----> Bank03 ----> Bank04 ----> Bank05
 *
 * @author 王霄
 * @date 2022/3/4 22:47
 */
@Configuration
public class BankConfig {

    @Bean
    public Bank05 bank05() {
        return new Bank05();
    }

    @Bean
    public Bank04 bank04(Bank05 bank05) {
        return new Bank04(bank05);
    }

    @Bean
    public Bank03 bank03(Bank04 bank04) {
        return new Bank03(bank04);
    }

    @Bean
    public Bank02 bank02(Bank03 bank03) {
        return new Bank02(bank03);
    }

    @Bean
    public Bank01 bank01(Bank02 bank02) {
        return new Bank01(bank02);
    }
}
